package com.tiancheng.trade.payment.channel.bo;

import com.tiancheng.trade.commom.core.enums.SettleRuleTypeEnums;
import com.tiancheng.trade.payment.model.PaymentFlowDetail;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.time.LocalDateTime;

/**
 * @Date 2024/11/10
 * @Author DCH
 */
@Getter
@Setter
@NoArgsConstructor
public class PaymentFlowDetailBO extends PaymentFlowDetail {
    /**
     * 主订单流水创建时间
     */
    private LocalDateTime flowCreateTime;
    /**
     * 支付渠道
     */
    private String paymentChannel;
    /**
     * 业务编码
     */
    private String businessCode;
    /**
     * 机构支付通道id
     */
    private Long orgPaymentChannelId;


    public SettleRuleTypeEnums settleRuleTypeEnum(){
        return getSettleRuleCode().startsWith(SettleRuleTypeEnums.merchant.getCode())?SettleRuleTypeEnums.merchant:SettleRuleTypeEnums.product;
    }
}
